package com.zr.corporatefactory.controller;

import com.zr.corporatefactory.model.Corporate;
import com.zr.corporatefactory.model.CorporatePage;
import com.zr.corporatefactory.service.CorporateService;
import com.zr.util.ResultVo;
import com.zr.util.ResultVoBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * Created by 天赐 on 2019/12/25.
 */
@RestController
@CrossOrigin
public class CorporateController {

    @Autowired
    private CorporateService corporateService;

    @PostMapping("legalPerson/search")
    public ResultVo queryPage(@RequestBody @Valid CorporatePage corporatePage){

        ResultVo resultVo = corporateService.getPage(corporatePage);

        return resultVo;
    }
}
